package com.stack.common.exception;


/**
 * 业务性异常信息
 * @author
 *
 */
public class BusinessException extends RuntimeException{

	/**
	 * 
	 */
	private static final long serialVersionUID = 7733171782986811025L;
	
	private String code;
	
	private String message;
	
	private String[] params;

	private ErrorCode errorCode;

	public BusinessException() {
		super();
	}

	public BusinessException(ErrorCode errorCode) {
		super();
		this.errorCode = errorCode;
		this.code = errorCode.getErrorCode();
		this.message = errorCode.getErrorMessage();
	}

	public BusinessException(String code, String ... params) {
		super();
		this.code = code;
		this.params = params;
	}
//
//	public BusinessException(String code) {
//		super(EmodorErr.err(code));
//		this.code = code;
//		this.message = (EmodorErr.err(code));
//	}
//
	
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@Override
	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public String[] getParams() {
		return params;
	}

	public void setParams(String[] params) {
		this.params = params;
	}
}
